<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/ProcessState/processStateTwo" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="processStateTwo" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <g:hiddenField name="stepName" value="${params.stepName}" />
            <g:hiddenField name="state" value="${params.state}" />
            <label >状态：</label>&nbsp;
            <input type="text" name="ZH" value="${ZH}"/>


            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/ProcessState/exportExcel')" data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;
        </div>
    </form>
</div>

<div class="bjui-pageContent">
    <g:if test="${processStateTwo.size() > 0}">
        <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr id="t1">
                <g:each in="${tableHeadList}" status="j" var="headInstance">
                    <g:if test="${headInstance!='RN'}">
                        <th  width="125"><g:message code="${headInstance}" default="${headInstance}"/></th>
                    </g:if>
                </g:each>
            </tr>
            </thead>
            <tbody>
            <g:if test="${processStateTwo.size()>0}">
                <g:each in="${processStateTwo}" status="i" var="dataInstance">
                    <tr>
                        <g:each in="${tableHeadList}" status="j" var="headInstance">
                            <g:if test="${headInstance=='LOT_QTY'}">
                                <td name="lotQty${i+1}">
                                    <a href="${request.getContextPath()}/ProcessState/processStateThree?partName=<%=dataInstance.PART_NAME%>&stepName=<%=dataInstance.STEP_NAME%>&state=<%=dataInstance.ZH%>" data-toggle="navtab"  data-id="dialog-normal" data-options="{id:'processStateThree', title:'工序状态分析表三阶'}">${dataInstance["${headInstance}"] }</a>
                                </td>
                            </g:if>
                            <g:elseif test="${headInstance!='RN'}">
                                <td>${dataInstance["${headInstance}"]}</td>
                            </g:elseif>
                        </g:each>
                    </tr>
                </g:each>
                <tr>
                    <td colspan="5">小计</td>
                    <td id="lotQty"></td>
                </tr>
                <tr>

                    <td colspan="5">合计</td>
                    <td>${processStateTwoSumQty[0].SUM_LOT_QTY}</td>
                </tr>
            </g:if>
            <g:else>
                <g:render template="../template/emptyPanel" />
            </g:else>
            </tbody>
        </table>
    </g:if>
</div>
<g:render template="../template/pagination" />

<script>
    $(function(){
        /*获取当页数量的小计*/
        var progressN=0
        for(var i=1;i<=${processStateTwo.size()};i++){
            var progressNo='lotQty'+i
            var progressNor=$("td[name='"+progressNo+"']").text()==''?0:parseInt($("td[name='"+progressNo+"']").text());
            progressN+=progressNor
        }
        $("#lotQty").html(progressN);
    })
</script>

